home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4586 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  964 b 

  1. Path: info.spt.net.cn!usenet
  2. From: Xu Yifeng <jafd@public.sta.net.cn>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Sun compiler bug?
  5. Date: Wed, 31 Jan 1996 07:01:36 -0800
  6. Organization: Shanghai Post & Telecommunication
  7. Message-ID: <310F8450.4C37@public.sta.net.cn>
  8. References: <4ejgfl$938@sun132.spd.dsccc.com>
  9. NNTP-Posting-Host: ts1-7.sta.net.cn
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6b (Win16; I)
  14.  
  15. Kevin Cline wrote:
  16. |> 
  17. |> The Sun version 4 compiler won't compile this:
  18. |> 
  19. |>     class X {
  20. |>       typedef int T;
  21. |>     };
  22. |> 
  23. |>     enum E { T = 0 };
  24. |> 
  25. |> It complains:
  26. |>         "foo.C", line 5: Error: Multiple declaration for T.
  27. |> 
  28. |> Is this a bug, or is am I misunderstanding the scoping rules?
  29. |> 
  30. |> Thanks.
  31. |> --
  32. |> Kevin Cline
  33.  
  34. It is a big bug according new C++ standard, new C++ standard supports
  35. type nest, this error will apear in old version C++.
  36.  
  37. Best Wishs,
  38. Xu Yifeng
  39.